/*
** Copyright (C) 2011 Viens Yann
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef OBJECT2D_HPP_
# define OBJECT2D_HPP_

# include "Coord2I.hpp"

class			Object2D
{
public:
  Object2D();
  Object2D(const int posX, const int posY, const int dirX, const int dirY, const int sizeX, const int sizeY);
  Object2D(Coord2I const& pos, Coord2I const& dir, Coord2I const& size);
  virtual ~Object2D();
  void			setPos(Coord2I const & pos);
  void			setPos(const int x, const int y);
  Coord2I const&	getPos() const;
  void			setDir(Coord2I const& dir);
  void			setDir(const int x, const int y);
  Coord2I const&	getDir() const;
  Coord2I&		getDir();
  void			setSize(Coord2I const& size);
  void			setSize(const int x, const int y);
  Coord2I const&	getSize() const;

  virtual void		move();
  virtual bool		checkCollision(Object2D const& obj) const;
  void			rebounds(Object2D& object, const int modifX = 0, const int modifY = 0);

protected:
  Coord2I			_pos;
  Coord2I			_dir;
  Coord2I			_size;
};

#endif // !OBJECT2D_HPP_
